#include "test_ctrl.h"

void TestCtrl::asyncHandleHttpRequest(const HttpRequestPtr &req, std::function<void(const HttpResponsePtr &)> &&callback) {
	auto resp = HttpResponse::newHttpResponse();
	LOG_INFO << "test ctrl";
	resp->setStatusCode(k200OK);
	resp->setContentTypeCode(CT_APPLICATION_JSON);
	resp->setBody("{\"code\": 200, \"data\": \"ok!\"}");
	// resp->setContentTypeCode(CT_TEXT_HTML);
	// resp->setBody("<h3>Service Started!</h3>");
	callback(resp);
}
